package com.neusoft.elmboot.po;

public class CreditTrans {
    
    private int id;
    private String userId;
    private int channelId;
    private int eventId;
    private int credit;
    private String createTime;
    private String expiredTime;
    private int leftVal;

    // 默认构造函数
    public CreditTrans() {
    }

    // 全参构造函数
    public CreditTrans(int id, String userId, int channelId, int eventId, int credit, String createTime, String expiredTime, int leftVal) {
        this.id = id;
        this.userId = userId;
        this.channelId = channelId;
        this.eventId = eventId;
        this.credit = credit;
        this.createTime = createTime;
        this.expiredTime = expiredTime;
        this.leftVal = leftVal;
    }

    // Getter和Setter方法
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public int getChannelId() {
        return channelId;
    }

    public void setChannelId(int channelId) {
        this.channelId = channelId;
    }

    public int getEventId() {
        return eventId;
    }

    public void setEventId(int eventId) {
        this.eventId = eventId;
    }

    public int getCredit() {
        return credit;
    }

    public void setCredit(int credit) {
        this.credit = credit;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getExpiredTime() {
        return expiredTime;
    }

    public void setExpiredTime(String expiredTime) {
        this.expiredTime = expiredTime;
    }

    public int getLeftVal() {
        return leftVal;
    }

    public void setLeftVal(int leftVal) {
        this.leftVal = leftVal;
    }

    // toString方法
    @Override
    public String toString() {
        return "CreditTrans{" +
                "id=" + id +
                ", userId='" + userId + '\'' +
                ", channelId=" + channelId +
                ", eventId=" + eventId +
                ", credit=" + credit +
                ", createTime='" + createTime + '\'' +
                ", expiredTime='" + expiredTime + '\'' +
                ", leftVal=" + leftVal +
                '}';
    }

    // equals和hashCode方法
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        CreditTrans that = (CreditTrans) o;

        if (id != that.id) return false;
        if (channelId != that.channelId) return false;
        if (eventId != that.eventId) return false;
        if (credit != that.credit) return false;
        if (!userId.equals(that.userId)) return false;
        if (!createTime.equals(that.createTime)) return false;
        if (!expiredTime.equals(that.expiredTime)) return false;
        return leftVal == that.leftVal;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + userId.hashCode();
        result = 31 * result + channelId;
        result = 31 * result + eventId;
        result = 31 * result + credit;
        result = 31 * result + createTime.hashCode();
        result = 31 * result + expiredTime.hashCode();
        result = 31 * result + leftVal;
        return result;
    }
}